<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        /* PC 端 鼠标悬停 */
        button:hover {
            background-color: gold;
        }

        /* 移动端 按下状态 */
        button:active {
            background-color: red;
        }
    </style>
</head>

<body>
    <button>悬我头上</button>
</body>

</html>